﻿using Stardust.ConfigCenterWeb.Code;
using Stardust.ConfigCenterWeb.Code.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TaskScheduler;

namespace Stardust.ConfigCenterWeb
{
    public class TaskJobConfig
    {
        public static void RegisterJobs(Scheduler scheduler)
        {
            //监测是否是活的
            scheduler.AddJob("CheckAlive", new SimpleTrigger(CCConfig.CheckAliveIntervalSeconds, 0), (sch, trigger) =>
            {
                ServerNodeService.Instance.CheckAliveJob();
            });

            //检测断开的节点
            scheduler.AddJob("CheckRegister", new SimpleTrigger(CCConfig.CheckRegisterIntervalSeconds, 0), (sch, trigger) =>
            {
                ServerNodeService.Instance.CheckRegisterJob();
            });
        }
    }
}